use sha2::{Sha256, Digest};

pub fn verify_model(path: &Path, expected_hash: &str) -> Result<bool, std::io::Error> {
    let mut file = std::fs::File::open(path)?;
    let mut hasher = Sha256::new();
    std::io::copy(&mut file, &mut hasher)?;
    let result = format!("{:x}", hasher.finalize());
    Ok(result == expected_hash)
}